//
//  WH_ShareOrderCell.m
//  App_6.23
//
//  Created by wanghao on 16/6/29.
//  Copyright © 2016年 wanghao. All rights reserved.
//

#import "WH_ShareOrderCell.h"
#import "WH_Home.h"

@interface WH_ShareOrderCell ()

@property (weak, nonatomic) IBOutlet UIImageView *avatarImage;
@property (weak, nonatomic) IBOutlet UILabel *userNameL;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *productNameL;
@property (weak, nonatomic) IBOutlet UILabel *peroidL;
@property (weak, nonatomic) IBOutlet UILabel *contentL;
@property (weak, nonatomic) IBOutlet UIImageView *showImageO;
@property (weak, nonatomic) IBOutlet UIImageView *showImageT;
@property (weak, nonatomic) IBOutlet UIImageView *showImageH;

@end

@implementation WH_ShareOrderCell

-(void)setShowOrder:(WH_Home *)showOrder{
    
    if (_showOrder != showOrder) {
        
        _showOrder = showOrder;
    }
    
    [self.avatarImage sd_setImageWithURL:[NSURL URLWithString:self.showOrder.user_avatar] placeholderImage:PLACEHOLDER_CELL_SAME];
    self.userNameL.text = self.showOrder.user_name;
    self.timeLabel.text = self.showOrder.show_time;
    self.titleLabel.text = self.showOrder.show_title;
    self.productNameL.text = self.showOrder.product_name;
    self.peroidL.text = [NSString stringWithFormat:@"期号: %@",self.showOrder.product_period_no];
    self.contentL.text = self.showOrder.show_content;
    
    if (self.showOrder.show_image_array.count == 1) {
        
        [self.showImageO sd_setImageWithURL:[NSURL URLWithString:self.showOrder.show_image_array[0]] placeholderImage:PLACEHOLDER_CELL_SAME];
    }
    if (self.showOrder.show_image_array.count == 2) {
        
        [self.showImageO sd_setImageWithURL:[NSURL URLWithString:self.showOrder.show_image_array[0]] placeholderImage:PLACEHOLDER_CELL_SAME];
        [self.showImageT sd_setImageWithURL:[NSURL URLWithString:self.showOrder.show_image_array[1]] placeholderImage:PLACEHOLDER_CELL_SAME];
    }
    if (self.showOrder.show_image_array.count == 3) {
        
        [self.showImageO sd_setImageWithURL:[NSURL URLWithString:self.showOrder.show_image_array[0]] placeholderImage:PLACEHOLDER_CELL_SAME];
        [self.showImageT sd_setImageWithURL:[NSURL URLWithString:self.showOrder.show_image_array[1]] placeholderImage:PLACEHOLDER_CELL_SAME];
        [self.showImageH sd_setImageWithURL:[NSURL URLWithString:self.showOrder.show_image_array[2]] placeholderImage:PLACEHOLDER_CELL_SAME];
    }
}

- (void)awakeFromNib {
    // Initialization code
        
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
